<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:pe="http://primefaces.org/ui/extensions"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="/templates/templateLayout.xhtml">

	<f:metadata>
		<f:viewParam name="id" value="#{userBean.id}" />
		<f:event type="preRenderView" listener="#{userBean.inicio()}" />
	</f:metadata>

	<ui:define name="centerContent">
		<h:panelGroup layout="block"
			class="title ui-widget-header ui-corner-all"
			style="padding: 8px; font-size: 16px !important; text-align: center;">
			
			<h:outputText value="#{msgs['form.usuario.modificar']}" rendered="#{!empty userBean.entity.id}"/>
			<h:outputText value="#{msgs['form.usuario.crear']}" rendered="#{empty userBean.entity.id}"/>
			

			<h:form id="create">

				<p:panel id="panelCreate">
					<p:messages  showDetail="true"  closable="true" showSummary="true"/>
					<p:panelGrid  style="width: 100%;text-align:left">
						<p:row>
							<p:column style="width: 15%;">
								<h:outputLabel for="userBeanTaskDescription"
									value="#{msgs['form.usuario']}#{msgs.obligatorio}" />
							</p:column>
							<p:column style="width: 85%;">
								<p:inputText id="userBeanTaskDescription"
									value="#{userBean.entity.username}" />
								<p:message for="userBeanTaskDescription" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>
								<h:outputLabel for="userBeanPass" value="#{msgs['form.pass']}#{msgs.obligatorio}" />
							</p:column>
							<p:column>
								<p:inputText id="userBeanPass"
									value="#{userBean.entity.password}" />
								<p:message for="userBeanPass" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>
								<h:outputLabel for="userBeansurname"
									value="#{msgs['form.nombre']}#{msgs.obligatorio}" />
							</p:column>
							<p:column>
								<p:inputText id="userBeansurname"
									value="#{userBean.entity.firstName}" />
								<p:message for="userBeansurname" />
							</p:column>
						</p:row>
						<p:row>
							<p:column>
								<h:outputText value="#{msgs['form.rol']}#{msgs.obligatorio}" />
							</p:column>
							<p:column>
								<p:selectOneMenu value="#{userBean.entity.role}"
									converter="#{roleConvert}" effect="fade">
									<f:selectItems value="#{roleBean.roles}" var="p"
										itemLabel="#{p.description}" itemValue="#{p}"
										onValue="Seleccione Role" />
								</p:selectOneMenu>
							</p:column>
						</p:row>
					</p:panelGrid>

					<f:facet name="footer">
						<ui:include src="/templates/toolbarCreate.xhtml">
							<ui:param name="bean" value="#{userBean}" />
						</ui:include>
					</f:facet>
				</p:panel>





			</h:form>
		</h:panelGroup>
	</ui:define>
	<ui:define name="dialogsDelete">
		<h:form id="diagolDeletes" prependId="false">
			<ui:include src="/pages/shared/commonPerson.xhtml">
				<ui:param name="bean" value="#{userBean}" />
			</ui:include>
		</h:form>
	</ui:define>
</ui:composition>
</html>
